from loggingconf.log import logger
from Camera.Camera import Camera
from configurations.cpp import cp
from utils.speaker import speaker
import os

isguide = cp.getboolean("guide","isguide")
cameralist = []
camera_id = cp.getint("camera_dev","camera_id")
cap0 = Camera(camera_id,cp.get("store","storepath0"))
cameralist.append(cap0)


def init():
    if not os.path.exists(cp.get("store","storepath0")):
        os.mkdir(cp.get("store","storepath0").encode("utf-8"))


def main():
    for cap in cameralist:
        cap.initialize()
    if isguide:
        speaker.initialize()


if __name__ == '__main__':
    init()
    main()
    logger.info("Done")